﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ASoft.Base;

namespace ASoft.Web.Base
{
    public class CustomAUser : AEntity
    {
        [EntityColumn]
        public int CustomAUserId { get; set; }

        [EntityColumn]
        public int CustomId { get; set; }

        [EntityColumn]
        public int AUserId { get; set; }

        AUser _AUser;
        public AUser AUser
        {
            get
            {
                if (_AUser == null || _AUser.AUserId != AUserId)
                {
                    _AUser = CurrentContext.AUserRepository.GetById(AUserId);
                }
                return _AUser;
            }
        }

        Custom _Custom;
        public Custom Custom
        {
            get
            {
                if (_Custom == null || _Custom.CustomId != CustomId)
                {
                    _Custom = CurrentContext.CustomRepository.GetById(CustomId);
                }
                return _Custom;
            }
        }


        public string CustomFK
        {
            get
            {
                return Custom.ToString();
            }
        }

        public string AUserFK
        {
            get
            {
                return AUser.ToString();
            }
        }

    }
}
